import request from '@/utils/request'

// 查询视频列表
export function listVideo (query) {
  return request({
    url: '/system/video/list',
    method: 'get',
    params: query
  })
}

// 查询视频详细
export function getVideo (id) {
  return request({
    url: '/system/video/' + id,
    method: 'get'
  })
}

// 新增视频
export function addVideo (data) {
  return request({
    url: '/system/video',
    method: 'post',
    data: data
  })
}

// 修改视频
export function updateVideo (data) {
  return request({
    url: '/system/video',
    method: 'put',
    data: data
  })
}

// 删除视频
export function delVideo (id) {
  return request({
    url: '/system/video/' + id,
    method: 'delete'
  })
}

// 加载用户行为
export function loadBehavior (data) {
  return request({
    url: '/system/behavior/load',
    method: 'post',
    data: data
  })
}

// redis收藏
export function collectBehavior (data) {
  return request({
    url: '/system/behavior/collect',
    method: 'post',
    data: data
  })
}

// redis喜欢
export function likesBehavior (data) {
  return request({
    url: '/system/behavior/likes',
    method: 'post',
    data: data
  })
}

// redis关注
export function followBehavior (data) {
  return request({
    url: '/system/behavior/follow',
    method: 'post',
    data: data
  })
}

// 新增视频并返回视频id
export function addAndReturnVideoId (data) {
  return request({
    url: '/system/video/addAndReturnVideoId',
    method: 'post',
    data: data
  })
}

// 热门视频
export function hotVideo (data) {
  return request({
    url: '/system/video/hotVideo',
    method: 'post',
    data: data
  })
}
